//
//  LGSiJiPublicFinshViewController.m
//  ligenyun
//
//  Created by Mac on 2018/3/24.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGSiJiPublicFinshViewController.h"

@interface LGSiJiPublicFinshViewController ()
@property(nonatomic, strong) NSMutableArray                     *finshDataSouce;
@end

@implementation LGSiJiPublicFinshViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"纪念馆信息";
    [self configDataSouce];
}
- (void)configDataSouce{
    self.finshDataSouce = [self.dataSouce mutableCopy];
    STTableEasyModel * model =  [[STTableEasyModel alloc] initWithTextString:@"纪念馆号码" detailString:@"212313"];
    [self.finshDataSouce insertObject:model atIndex:0];
    
    STTableEasyModel * yinxiangModel =  [[STTableEasyModel alloc] initWithTextString:@"印象" detailString:@"永垂不朽"];
    [self.finshDataSouce addObject:yinxiangModel];
    
    STTableEasyModel * typemodel =  [[STTableEasyModel alloc] initWithTextString:@"纪念馆号风格" detailString:@"永垂不朽"];
    [self.finshDataSouce addObject:typemodel];
    
    [self.tableView reloadData];
    __weak typeof(self) weakSelf =  self;
    STButton * nextButton = [TMUtils deflutNextButton];
    [nextButton setClicAction:^(UIButton *sender) {
        [weakSelf onSlectedFinshButton];
    }];
    [nextButton setTitle:@"确认创建" forState:UIControlStateNormal];
    [self.view addSubview:nextButton];
}
#pragma --mark UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.finshDataSouce.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 44;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 44;
}
- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView * view = [TMUtils headerViewWithTitle:@"逝者信息"];
    return view;
}
- (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    return [UIView new];
}
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString * reuseIdentifier =  @"cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuseIdentifier];
        
    }
    cell.textLabel.textColor = UIColorFromRGBA(0x333333);
    cell.textLabel.font = [UIFont systemFontOfSize:14];
    cell.detailTextLabel.font = [UIFont systemFontOfSize:13];
    cell.detailTextLabel.textColor = UIColorFromRGBA(0x999999);
    STTableEasyModel * model = self.finshDataSouce[indexPath.row];
    [cell setSt_tableEasyModel:model];
   // cell.textLabel.text = [NSString stringWithFormat:@"%@*必填",cell.textLabel.text];
   // cell.textLabel.attributedText = [cell.textLabel.text st_convertAttributeStringWithKeyWord:@"*必填" attributes:@{NSForegroundColorAttributeName:FlatRed}];
    cell.accessoryType = UITableViewCellAccessoryNone;
    return cell;
}
- (void)onSlectedFinshButton{
    LGPayPresentViewController * vc = [LGPayPresentViewController new];
    [self presentViewController:vc animated:NO completion:nil];
}


@end
